<extend name="Base/common"/>
<block name="header">
	</block>
	
<block name="body">
<style>
.page-app{ background:#f0f0f0;}
body{background:#f0f0f0;}
</style>
<div id="loading" style="display: block;"><div class="loadingbox"><section class="ffffbox"><div class="loadingpice"></div></section></div></div> 
<!-- <div id="hallist">  -->
	
 <div class="toptitCon">
 <div class="toptitBox">
  <div class="toptitL"><i></i></div>
  <div class="toptitC"><h3 style="font-weight:bold; font-size:20px;">鲜果屋生鲜旗舰店</h3></div>
 
  <div   onclick="myFavorite(4,this); "    class="toptitR"><i class="ordiscoll"></i></div>
  <div style="display:none;"  onclick="delFav(4,this);"   class="toptitR"><i class="ordiscoll1"></i></div>
   
 </div>
</div>
 



<!--链接-->
<div class="ordislink">
 <ul>
  <li  onclick="dolink('http://localhost/wmrshop/index.php?ctrl=wxsite&action=shopshow&typelx=wm&id=4');"  class="ordislinkaA">点菜</li>
  <li  onclick="dolink('http://localhost/wmrshop/index.php?ctrl=wxsite&action=getshopcomment&typelx=wm&shopid=4');"  >ee评价</li>
  <li  onclick="dolink('http://localhost/wmrshop/index.php?ctrl=wxsite&action=getdetailinfo&typelx=wm&shopid=4');" ">商家</li>
 </ul>
</div>


	
	 
 
		
 <!--提示-->
<div class="ordisprompt" style="position:absolute; top:83px; z-index:99;">
 <ul>
  <li><i></i></li> 
  <li id="gonggaoshow" style="margin-left:0px; float:left; width:90%;">
  <div id="marqueenotice" style="display:none;"><marquee align="top" behavior="scroll" scrollamount="4" width="100%"    direction="left" onmouseover="this.stop();" onmouseout="this.start();"  >光合外卖旗舰店，汇集国内顶级厨师，川菜粤菜鲁菜淮扬菜，样样精通。 &nbsp;</marquee>
  </div>
  <div id="notice">光合外卖旗舰店，汇集国内顶级厨师，川菜粤菜鲁菜淮扬菜，样样精通。 &nbsp;</div>
  </li>
 </ul>
</div>
<!--点菜-->
 
<script>
$(function(){
	var gonggaoshow = Number( $("#notice").text().length )*16;
	var screenwidth = document.body.clientWidth-20;
	if( gonggaoshow >= screenwidth ){
  
		$("#marqueenotice").show();
		$("#notice").hide();
	}else{
	 
		$("#marqueenotice").hide();
		$("#notice").show();
	}
});
</script>



<div  id="standard" style="width:20%;  position:absolute; top:117px; z-index:9;bottom:70px; " >

 <div class="ordisordLeft"   style="width:100%;">
 	
 	
  <ul>
  <!-- ordisordaA  -->
   <volist name="list" id="Catlist">
   	
   		<li cateid="284" class="ordisordaA" ><a>{$Catlist.cat_name}</a></li>   
   		
     
   </volist>
  </ul>
 </div>
 
</div> 


<div id="transition"  style="width:80%;  position:absolute; top:117px;  bottom:70px; z-index:9;  left:20%; "  >



 <div class="ordisordRight" id="catefoods"  style="width:100%; background:#fff;" >
	 <!-- 点击分类ajax获取分类下的所有商品 -->
 </div>
 
 
</div>
 
<!-- 获取评论内容 -->
<div id="getpinglun" style="display:none;width:100%; position:absolute;z-index:99; top:83px; bottom:70px;">
	 
	<div class="huoqucomment">
		
	</div>
</div>

 <!-- 获取商家详情 -->
<div id="getdetailinfo" style="width:100%;display:none; position:absolute;z-index:99; top:83px; bottom:70px;">
	<div class="getdetailinfo">
	 
	</div>
</div>
 
 
		 <div style="height:10px;"></div>
	 
 <script>
 var click_button = false;
function doubleclick(){
	click_button = false;
}
function lockclick(){
	 if(click_button == false){
			click_button = true;
			setTimeout("doubleclick()", 400); 
			return true;
	 }else{
		 return false;
	 }
}

 var is_open = false; 
 $(function(){  
 	  $('.return').bind("click", function() {    
	    history.back();
   }); 
   
   $('.toptitBox .toptitL').bind("click", function() {    
	    history.back();
   });
 });
 
 
 
 
 $(document).ready(function(){ 

	 $(".ordisordLeft li").bind('click',function(){
	
		  if(lockclick()){  
		  
			$(".ordisordLeft li").removeClass('ordisordaA');
			$(this).addClass('ordisordaA');
			getcatefoods();
		  }
	 });
	 
	 $("#getcomment").bind('click',function(){
		$(".ordislink li").removeClass('ordislinkaA');
		$(this).addClass('ordislinkaA');
		$(".ordisprompt").hide();
		$("#standard").hide();
		$("#transition").hide();
		
		$("#getdetailinfo").hide();
		$(".getdetailinfo").html('');
		
		$("#getpinglun").show();
			var url = 'http://localhost/wmrshop/index.php?ctrl=wxsite&action=getshopcomment'; 
					$.post(url, {'shopid':4},function (data, textStatus){ 
							$('.huoqucomment').html(data); 
						 
							scroll3.refresh();
							 
							
						}, 'html');
		
		
	 });
	 
	 
	 $("#getshopmenu").bind('click',function(){
		$(".ordislink li").removeClass('ordislinkaA');
		$(this).addClass('ordislinkaA');
		$(".huoqucomment").html('');
		$("#getpinglun").hide();
		$(".ordisprompt").show();
		$("#standard").show();
		$("#transition").show();
		$("#getdetailinfo").hide();
		$(".getdetailinfo").html('');
		scroll1.refresh();
		scroll2.refresh();
		
	 });
	 
	  $("#getshopinfo").bind('click',function(){
		$(".ordislink li").removeClass('ordislinkaA');
		$(this).addClass('ordislinkaA');
		$(".huoqucomment").html('');
		$("#getpinglun").hide();
		$(".ordisprompt").hide();
		$("#standard").hide();
		$("#transition").hide();
		
		$("#getdetailinfo").show();
		 var url = 'http://localhost/wmrshop/index.php?ctrl=wxsite&action=getdetailinfo'; 
					$.post(url, {'shopid':4},function (data, textStatus){ 
							$('.getdetailinfo').html(data); 
						 
							scroll4.refresh();
							 
							
						}, 'html');
		
	 });
	 
	 
	 
	 
	  /* 点击展示购物车详情  */
	$(".ordeilpaymenshop").bind('click',function(){
  		 $('#zhezhao').toggle(); 
		 $("#showorderdet").toggle();
		
		 freshowdetcart();
		 
	 	
	}); 
	
	$("#zhezhao").bind('click',function(){
		$(this).toggle();
		$("#showorderdet").toggle();
	});
	
	
	
	 
	 
 })
  
function getcatefoods(){

		var curcateid = $(".ordisordLeft li.ordisordaA").attr('cateid');
	 
			$("#catefoods").html();
			var url = 'http://localhost/xgwshop//index.php/Home/Goods/goodslist'; 
					$.post(url, {'curcateid':curcateid,'shoptype':0,'shopid':4,'type':1},function (data, textStatus){ 
							$('#catefoods').html(data); 
							  freshcart();
					 	scroll2.refresh();
							
							
							
							$('.righ_l_b_btn_moren').unbind();
							
							 $('.righ_l_b_btn_moren').bind("click", function() {   
		 
								 if(lockclick()){ 
										 if($(this).attr('have_det') == 1){
										 addproduct($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
										 }else{
									   addonedish($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
									   }
								  }
										
								
							  }); 
							   $('.right_l_btn_left').bind("click", function() {   
									if($(this).attr('have_det') == 1){
										removeoneproduct($(this).attr('data-id'),$(this).attr('data-shopid'),1);
									   }else{
										removeonedish($(this).attr('data-id'),$(this).attr('data-shopid'),1);
										}
							  }); 
							   $('.right_l_btn_right').bind("click", function() {   
									if(lockclick()){
										 if($(this).attr('have_det') == 1){
											addproduct($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
										 }else{
											addonedish($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
									   }
									  }
									 
							  }); 
							
							
							
							
							
							
							
							
							
							
							
						}, 'html');
						
}	
 
//添加店铺收藏
function myFavorite(shopid,obj)
{ 
  var url = siteurl+'/index.php?ctrl=shop&action=addcollect&datatype=json&collectid='+shopid+'&type=0'; 
  var backinfo = ajaxback(url,{});
  if(backinfo.flag == false){ 
     		$(obj).hide(); 
     		$(obj).next().show(); 
     	//	$('#CancelFavShop').show();
   }else{ 
   	Tmsg(backinfo.content); 
  }
}  
//删除店铺收藏
function delFav(shopid,obj)
{ 
	var url = siteurl+'/index.php?ctrl=shop&action=delcollect&datatype=json&collectid='+shopid+'&type=0'; 
  var backinfo = ajaxback(url,{});
  if(backinfo.flag == false){ 
      $(obj).hide(); 
	  $(obj).prev().show(); 
     // $('#CancelFavShop').hide();
   }else{ 
   	 Tmsg(backinfo.content); 
  }  
}
 
 
 
	  /* 点击展示购物车详情  */
	$(".ordeilpaymenshop").bind('click',function(){
  		 $('#zhezhao').toggle(); 
		 $("#showorderdet").toggle();
		
		 freshowdetcart();
		 
	 	
	}); 
	
	$("#zhezhao").bind('click',function(){
		$(this).toggle();
		$("#showorderdet").toggle();
	});
	
 
 function freshowdetcart(){
			 url = siteurl+'/index.php?ctrl=wxsite&action=cart&shopid='+shopid+'&datatype=json&random=@random@';
			url = url.replace('@random@', 1+Math.round(Math.random()*1000));
			var bk = ajaxback(url,''); 
			if($('#showorderdet .showorderList').html() == undefined){
 			}else{
			 showcartdet(bk);
			 
			}
		//	Tmsg($('#showorderdet').find('.box_inline').length);
			
			
		 
		 
	}
function showcartdet(datas){ 
 
 	 $('#showorderdet .showorderList').html(''); 
 	  if(datas.flag == false){    
    	   //	$('.listcontent').remove();
    	var temp_htmls = '';
           $('#showorderdet .showorderList').append(temp_htmls);
    	 	  $.each(datas.content.list, function(i,val){    
    	 	 	  var htmls = template.render('cartlist', {list:val});
    	 	 	  $('#showorderdet .showorderList').append(htmls);
    	    }); 
 		 
    	  
           $('.addbtn').bind("click", function() {   
      	    	if(checknext ==  false){ 
      	    		checknext = true;
					var checkhavedet = $(this).attr('have_det');
					 
					if(checkhavedet == 1){					 
						  uponeproduct($(this).attr('product_id'),$(this).attr('data-shopid'),1);
						 freshowdetcart();
					}else{
					 
						addonedish($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
					 	freshowdetcart();
						
				   }
				  
      	     	   setTimeout("myyanchi()", 500 );
           	  }
      	 	
          }); 
           $('.downdbtn').bind("click", function() {   
           	  if(checknext ==  false){ 
           	  		checknext = true;
					var checkhavedet = $(this).attr('have_det');
					if(checkhavedet == 1){
						 removeoneproduct($(this).attr('product_id'),$(this).attr('data-shopid'),1);
						 freshowdetcart();
					 
					}else{
						
						removeonedish($(this).attr('data-id'),$(this).attr('data-shopid'),1,this);
						freshowdetcart();
						 freshcart();
						 
				   }
				  
      	     	   setTimeout("myyanchi()", 500 );
           	  }
      	 	
          });
		   $('.showorderList').css('height',$('#showorderdet').find('.box_inline').length*49);
		   scroll5.refresh();
		 
     	  
    }else{
  		 
          $('#cartlist').hide();
      
          
       
    }
} 
 /* 点击展示购物车详情   end*/
		
  </script>
  
 <div id="zhezhao" style=""></div>
 
 
 <!--底部-->

 
<script id="cartlist" type="text/html">   
 
 <div class="box_inline goodsli" style="padding:5px 5px 5px 8px;border-top: 1px solid #cccccc; "    id="gidli_<^%=list.id%^> "  >
		<div class="liwd30 detcart"  style="width:50%; text-align:left;">
		<^%=list.name%^>
		<^%if(list.have_det==1){%^><font style="color:#ccc;font-size:10px;">【<^%=list.gg.attrname%^>】</font><^%}%^>
			</div>
		<div class="liwd30 detcart" style="width:20%; text-align:left;">
			￥<^%=list.cost%^>
			</div>
			<div class="liwd30 detcart" style="width:30%; text-align:center;">
			<div style="width:90px; height:38px; line-height:38px;">
			<span class="addbtn" have_det="<^%=list.have_det%^>"  <^%if(list.have_det==1){%^> product_id="<^%=list.gg.id%^>" <^%}%^>  data-id="<^%=list.id%^>" data-shopid="<^%=list.shopid%^>"><img src="http://localhost/wmrshop/templates/m7/public/wxsite/images/showcart-jiab.png" /></span>
			<span class="shuliang gdhd"><^%=list.count%^></span>
			<span class="downdbtn " have_det="<^%=list.have_det%^>"  <^%if(list.have_det==1){%^> product_id="<^%=list.gg.id%^>" <^%}%^>     data-id="<^%=list.id%^>" data-shopid="<^%=list.shopid%^>"><img style="width:21px;" src="http://localhost/wmrshop/templates/m7/public/wxsite/images/showcart-jian.png" /></span>
			</div>
			</div>
	</div>
 
 </script>
<div id="showorderdet" >
	<div class="showorderList">

 
	</div>
</div>



<!--支付-->
<div class="ordeilpaymenCon" style="position:absolute; bottom:0px; z-index:99999999999;">

 <div class="ordeilpaymenshop"><i id="total_count">0</i></div>
 
 
 <div class="emptycartBg"></div>
 
 
 <div class="ordeilpaymenBox">
 
 
 
  <div class="ordeilpaymen">
   <ul>
    <li><b>合计：￥<span id="total_money" ></span></b></li>
	   </ul>
  </div>
  
  
  
 <div class="emptyordeilpaymen">
   <ul>
    <li><b>购物车是空的</b></li> 
   </ul>
  </div>

  <div  id="addShopping" class="ordeilpaybut"  onclick="dolink('http://localhost/wmrshop/index.php?ctrl=wxsite&action=shopcart&id=4');"   ><input type="button" value="去支付"></div>
  <div  id="showlimit" class="limitordeilpaybut"    ><input type="button" value="还差11元"></div>
 </div>
</div>

</block>


<block name="script">   
<!-- </div> -->

<script>
	$(function(){
		if( taction  == 'index' ){		
			$(".icon_home").next().css('color','#ff6e6e');
			$(".icon_home").css('backgroundPosition','0px -23px');		
		}
		if( taction  == 'member' ){		
			$(".icon_phone").next().css('color','#ff6e6e');
			$(".icon_phone").css('backgroundPosition','-92px -23px');		
		}
		if( taction  == 'order' ){		
			$(".icon_user").next().css('color','#ff6e6e');
			$(".icon_user").css('backgroundPosition','-23px -23px');		
		}
			if( taction  == 'togethersay' ){		
			$(".icon_order").next().css('color','#ff6e6e');
			$(".icon_order").css('backgroundPosition','-69px -23px');		
		}
	});
</script>
 <script>
 	$(function(){  		
 	   $('#loading').hide(); 
  });
  </script>
  
  
</block>
</html>
 